package io.gitee.thinkbungee;

import io.gitee.thinkbungee.crud.mongo.service.MongoCRUDHelper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

/**
 * 代码生成配置
 *
 * <p>
 * FilterType:
 * ANNOTATION,按照注解过滤，如@Service这些
 * ASSIGNABLE_TYPE,按照类型过滤，如xxx.class
 * ASPECTJ,按照aspectj表达式过滤，自定义表达式
 * REGEX,按照正则表达式过滤，自定义表达式
 * CUSTOM;按照自定义过滤规则过滤 自实现TypeFiler接口
 *
 * @author chenyichang
 * @date 2022/3/8
 */
@SpringBootApplication(exclude = {MongoAutoConfiguration.class, MongoDataAutoConfiguration.class})
@MapperScan(value = "io.gitee.thinkbungee.dao")
//satellite-spring-boot-common中集成了mongo，主要使用在MongoCRUDHelper类中，
//而自动生成器自实现了mongoClient，与spring-boot-starter-data-mongodb冲突，所以需要排除该类
@ComponentScan(value = "io.gitee.thinkbungee",
        excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,
                classes = {MongoCRUDHelper.class}))
public class SatelliteGeneratorApplication {
    public static void main(String[] args) {
        SpringApplication.run(SatelliteGeneratorApplication.class, args);
    }
}
